package com.wpw.web.design.single;

/**
 * @Description:
 * @ClassName: Singleton
 * @CreateDate: 2020-05-04 10:26
 * @author: wupengwei
 */
public class Singleton {

    private static volatile Singleton singleton;

    private Singleton() {
    }

    public static Singleton getInstance() {

        if (singleton == null) {
            synchronized (Singleton.class) {
                if (singleton == null) {
                    singleton = new Singleton();
                }
            }
        }
        return singleton;

    }

}